package com.wangrui.mapper;

import com.wangrui.utils.Page;
import com.wangrui.dto.UserSchool;
import com.wangrui.pojo.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 王锐
 * @since 2020-07-05
 */
public interface UserMapper extends BaseMapper<User> {
    //@Select("SELECT user.*,school.* from user,school WHERE user.sid=school.id")
/*
    @Select("<script>" +
            " SELECT user.*,school.*,role.* from user,school,role WHERE user.sid=school.id and user.id = role.role_id" +
            " <if test='keyword!= null'>" +
            " and user.truename like CONCAT(#{keyword})" +
            " </if>" +
            "limit #{start},#{pageSize}"+
            " </script>")
    List<UserSchool> getUserSchool( Page<UserSchool> page1);
*/

    @Select("<script>" +
            " SELECT user.*,school.* from user,school WHERE user.sid=school.id" +
            " <if test='keyword!= null'>" +
            " and user.truename like CONCAT(#{keyword})" +
            " </if>" +
            "limit #{start},#{pageSize}"+
            " </script>")
    List<UserSchool> getUserSchool( Page<UserSchool> page);






}
